<div ms-controller="homeworkView">

    <ol class="breadcrumb">
        <li><a href="#!/homework/list/">作业列表</a></li>
        <li class="active">作业详情</li>
    </ol>

    <div class="body">
        <h1>作业详情</h1>

        <hr class="col-xs-12">
        <h3 class="pull-right"><span>班级:{{_class.replace('#',',')}}</span></h3>
        <h3>{{title}}</h3>

        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">筛选</div>
                <select class="form-control" ms-duplex-number="myfilter">
                    <option value="0">全部</option>
                    <option value="-1">尚未提交</option>
                    <option value="1">已经提交</option>
                </select>
            </div>
        </div>
        <hr class="col-xs-12">
        <table class="table table-striped">
            <tr>
                <td class="col-xs-1">位置</td>
                <td class="col-xs-2">学号</td>
                <td class="col-xs-2">姓名</td>
                <td class="col-xs-1">班级</td>
                <td class="col-xs-6">作业</td>
            </tr>
            <tr ms-repeat="list">
                <td>#{{$index+1}}</td>
                <td>{{el.id}}</td>
                <td>{{el.name}}</td>
                <td>{{el.class}}</td>
                <td>
                    <div ms-if="el.homeworks.length==0">未提交作业</div>
                    <div ms-if="el.homeworks.length>0">
                        <div ms-repeat-h="el.homeworks" class="homework">
                            <h6>{{h.name}}<span>{{formatSize(h.size)}}</span></h6>
                            <p>{{h.description}}</p>
                            <a ms-attr-href="/file/download/{{h.path}}" ms-attr-download="/file/download/{{h.path}}">点击下载</a>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>

    <style>
        .table {
            font-size: 14px;
        }

        button.btn {
            font-size: 12px;
        }

        h3 > span, h6 > span {
            font-size: 0.8em;
            display: inline-block;
            padding-left: 4px;
            font-weight: lighter;
        }

        h6 {
            font-weight: bold;
        }

        .homework {
            padding: 4px;
            border-bottom: solid 1px #f0f0f0;
        }

        .homework > p {
            font-size: 12px;
            font-weight: lighter;
        }

        .homework:last-child {
            border-bottom: none;
        }

        .form-group {
            width: 200px;
            margin: 15px 10px 0 0;
        }
    </style>


</div>